//
//  AYMForceTouchClik.m
//  QuickCure
//
//  Created by MootYue on 16/5/14.
//  Copyright © 2016年 ayumi. All rights reserved.
//

#import "AYMForceTouchClik.h"

@interface AYMForceTouchClik ()

@end

@implementation AYMForceTouchClik


+(void)loginForceTouch{
    UIApplication *application = [UIApplication sharedApplication];
    //根据是否登录来判断显示的内容
    if ([UserDefault boolForKey:@"isUserLogiKey"]) {
        //因为找不到系统的用户icon图片只能自己加了
        UIApplicationShortcutIcon *useIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeContact];
        UIApplicationShortcutItem *userPage = [[UIApplicationShortcutItem alloc]initWithType:@"user" localizedTitle:@"我的资料" localizedSubtitle:nil icon:useIcon userInfo:nil];
        
        //增加第二个 我想直接跳到意见反馈里去
        UIApplicationShortcutIcon *suggestIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeMessage];
        
        UIApplicationShortcutItem *suggest = [[UIApplicationShortcutItem alloc]initWithType:@"sugge" localizedTitle:@"意见反馈" localizedSubtitle:nil icon:suggestIcon userInfo:nil];
        application.shortcutItems = @[userPage,suggest];

    }else{
        UIApplicationShortcutIcon *loginIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeHome];
        //这个就是3dtouch后显示的内容 分别是唯一标识符  显示的文字  文字下面的一行小字  图标  最后讲真的不知道怎么用(用龙骑士的话来说我们不关心它所以给他一个nil)
        UIApplicationShortcutItem *loginItem = [[UIApplicationShortcutItem alloc]initWithType:@"login" localizedTitle:@"登录" localizedSubtitle:nil icon:loginIcon userInfo:nil];
        application.shortcutItems = @[loginItem];
    }
}

@end
